package com.example.qfsx;

import android.annotation.SuppressLint;
import android.os.Bundle;
import android.widget.LinearLayout;
import android.widget.TextView;

import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;

import java.util.ArrayList;
import java.util.List;

public class SearchActivity extends AppCompatActivity {

    @SuppressLint("SetTextI18n")
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        EdgeToEdge.enable(this);
        setContentView(R.layout.activity_search);
        ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {
            Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
            v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
            return insets;
        });

        //循环
//        List<String> list = new ArrayList<>();
//        list.add("香蕉");
//        list.add("苹果");
//        list.add("榴莲");
//
//
//        LinearLayout view = findViewById(R.id.list);
//
//        runOnUiThread(()->{
//            for (String item:list){
//                TextView textView = new TextView(this);
//                textView.setTextSize(21);
//                textView.setText(item);
//                view.addView(textView);
//            }
//        });
    }
}